﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Services;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using A2DFramework.A2DConfiguration;
using A2DFramework.InstanceService;
using IoCTest.Core;

namespace IoCTest
{
    class Program
    {
        static void Main(string[] args)
        {
            A2DConfig.LoadConfig();

            ObjectFactory.Register<IOrder, OrderImpl>();

            var o1 = ObjectFactory.Resolve<IOrder>();

            int i = 1;
            while (true)
            {
                if (i % 11==0)
                    o1.UpdateMessage("changed at"+DateTime.Now);

                Thread.Sleep(1000);
                Console.WriteLine(o1.GetMessage());
                i++;
            }
        }
    }
}
